using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Q.Framework.Utility
{
    public static class ObjectUtility
    {
        public static object CreateBaseOnDictionary<T>(Dictionary<String, Object> dictionary) where T : new()
        {
            T obj = new T();

            foreach (var item in dictionary)
            {
                typeof(T).GetProperty(item.Key).SetValue(obj, item.Value, null);                
            }

            return obj;
        }
    }
}